package com.github.prontera.model.request;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author Alex
 */
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler", "fieldHandler" }, ignoreUnknown = true)
public class RegisterRequest extends RestfulRequest {

	private static final long serialVersionUID = -7019570768557438079L;

	@NotNull
	@NotBlank
	@Pattern(regexp = "^\\d{11}$", message = "请输入11位手机号")
	@JsonProperty("mobile")
	@ApiModelProperty(value = "手机号", example = "18888888888", required = true)
	private String mobile;

	@NotNull
	@Size(min = 6, max = 20, message = "请输入6~20位的密码")
	@JsonProperty("login_pwd")
	@ApiModelProperty(value = "登录与支付密码", example = "123123123", required = true)
	private String loginPwd;

	@NotNull
	@Min(100L)
	@Max(100000000L)
	@JsonProperty("balance")
	@ApiModelProperty(value = "用户的初始化余额", example = "100000000", required = true)
	private Long balance;

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getLoginPwd() {
		return loginPwd;
	}

	public void setLoginPwd(String loginPwd) {
		this.loginPwd = loginPwd;
	}

	public Long getBalance() {
		return balance;
	}

	public void setBalance(Long balance) {
		this.balance = balance;
	}

}
